In general, a computing environment represents the state of the computer and determines the kind of programs that can execute on the computer and how the programs may be run. To an extent, the computing environment is dependent upon the computer's operating system, and the operating system may support different environments. A computer may support two or more computing environments at the same time. Each environment is “external” to the other in the sense that they are logically separate, i.e., programs, classes and objects defined in one of the environments are not readily accessible in the other environment.
Either environment may be an interpretive environment or a compiled environment. An interpretive computing environment is one in which a pending high-level instruction is converted into an intermediate form, which the computer then converts to machine language and executes before turning to the net high-level instruction. Another environment may require compiling, rather than interpreting, the high-level instructions. Compiling entails translating a collection or group of high-level instructions into a lower-level language. Some compilers translate the collection of high-level instructions into machine language, which a computer may then execute. Other compilers translate the collection of high-level instructions into an intermediate form. These instructions in intermediate form may then be executed in order by an interpreter, or may be compiled as a group again for execution.
A particular environment need not be strictly interpretive or compiled, but may share attributes of both kinds of environments. In general, compiled programs run faster than interpreted programs, but are often more difficult to develop and debug. Interpreted programs are generally easier to debug and correct, but run more slowly than compiled programs.
An application written using a high-level computer programming language, such as C or C++, ordinarily is compiled prior to execution. The application itself, however, may behave like an interpreter, interactively carrying out instructions as each instruction is input by a user. The mathematical application MATLAB™ by MathWorks, Inc. of Natick, Mass., for example, is a compiled program that may behave like an interpreter. MATLAB provides a technical computing environment that combines numeric computation, advanced graphics and visualization, and a high-level programming language. The high-level programming language provides flow-control constructs and includes a variety of operators for performing numerical analysis, string manipulation, and graphical user interface (GUI) design. A MATLAB program generally executes instructions as each instruction is given by the user. A MATLAB user may, for example, define a square matrix with a single command. Once the matrix is defined, the user may manipulate the matrix, using one command to find its inverse, another command to find its transpose, or another command to learn its determinant. Each command is carried out as it is given, and MATLAB allows users to receive an acknowledgment that each command has been carried out. MATLAB does not need to be recompiled after every command. Accordingly, a MATLAB user may be said to be operating in an interpretive computing environment.
Other examples of programs where users may enter instructions interactively include VisualBasic™, SmallTalk, LISP, Mathematica™, and IDL™.
A modern and widely-used computing environment is the Java environment. The Java environment supports object-oriented programming in which reusable software components called “objects” form the building blocks of a computer program.
In the Java environment, programs written in the high-level Java language (also called the “source code”) are compiled by the Java compiler, creating a lower-level version of the program in the form of “bytecodes.” Bytecodes represent a formatted string of numbers, corresponding to an intermediate form of the program between the high-level Java language understood by people and the low-level machine language understood by computers. Bytecodes are converted into machine code by a machine code generator such as a “Java interpreter” or a “JIT (just-in-time) compiler.”
The bytecodes represent a form of the program recognized by the Java virtual machine. In general, a “virtual machine” is an abstract computing machine. Computer programs are essentially lists of instructions used to control a machine, and the instructions must be converted into the language of that machine before the instructions may be carried out. In some cases, the instructions control a hardware-based or “real” machine, such as a personal computer. Instructions to a “real” machine ordinarily conform to the native language of the hardware itself. In other cases, the instructions control a software-based computer program called a “virtual machine,” which in turn controls a real machine. Instructions to a virtual machine ordinarily conform to the virtual machine language. For the Java virtual machine, the virtual machine language is in bytecodes.
The Java virtual machine is only one of many virtual machines. Any interpreted language may be said to employ a virtual machine. The MATLAB program, for example, behaves like an interpretive program by conveying the user's instructions to software written in a high-level language, rather than to the hardware. An advantage of a virtual machine is that it is more specialized than the general-purpose hardware of a “real” machine. This specialization permits quick transformation from high-level language to bytecodes, often with fewer demands placed upon the computer hardware than would be made by a fully compiled language.
In an object-oriented computing environment, such as the Java environment, “objects” are modules of computer code that specify the data types of a data structure, and also the kinds of operations (or “methods”) that will be permitted to be applied to the data structure. A “class” may be thought of as a prototype that defines the data structures and methods common to all objects of a certain kind; thus, an object may be of a particular class. “Instantiation” of a class creates an object of that class. Classes that are in general referred to as Java “beans” (JavaBeans is a registered trademark of Sun Microsystems, Inc.), are of particular interest. Java beans are reusable software modules written in the Java language. To qualify as a Java bean, a class is written to follow a specific convention. Importantly, a Java bean supports “introspection,” meaning that the object-oriented computing environment may be queried about the bean, its properties, methods and events. This determination may take place while the Java program is executing, i.e., during “runtime.”
As used below, a reusable object-oriented class that supports introspection during runtime may be referred to as a “bean,” even if the class may not strictly qualify as a Java bean. The term “bean” will be used below more generally than the term is used in Java, and will include but not be limited to Java beans.
Under some circumstances a user may wish to combine the benefits of both environments. A user working in one computing environment may wish to take advantage of a particular module of computer code that operates exclusively in a second, object-oriented, computing environment.